﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Edit.Master" AutoEventWireup="true"
    CodeBehind="ResourceRequestWellList.aspx.cs" Inherits="Web.Views.ResourceRequestManage.ResourceRequestWellList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../../Javascript/UserControls.js" type="text/javascript"></script>
<%--    <link href="../../App_Themes/NewPage/Styles/kington.css" rel="Stylesheet" type="text/css" />--%>
    <script type="text/javascript">
        $(function () {
            $('#ctl00_edit_BtnResourceRequest').bind('click', function () {

                var checkCount = $("input:checked[id*='ctl00_edit_gv_SingleWellList']").length;
                if (checkCount > 0) {
                    $("#dd").dialog({
                        title: '申请内容',
                        width: 400,
                        height: 200,
                        closed: false,
                        cache: false,
                        modal: true,
                        buttons: [
                        {
                            icon: 'icon-save',
                            text: '申请访问',
                            handler: function () {
                                //alert($('#ctl00_edit_cbCanView').attr('checked'));
                                //alert($('#ctl00_edit_cbCanDownload').attr('checked'));
                                //alert($('#ctl00_edit_txtValidPeriod').datebox('getValue'));
                                if ($('#ctl00_edit_cbCanView').attr('checked') == false && $('#ctl00_edit_cbCanDownload').attr('checked') == false) {
                                    alert('浏览或者下载必须选择一项!');
                                    return;
                                }
                                if ($('#ctl00_edit_txtValidPeriod').datebox('getValue') == "" || $('#ctl00_edit_txtValidPeriod').datebox('getValue') == undefined) {
                                    alert('过期日期不能为空!');
                                    return;
                                }
                                $('#ctl00_edit_hdExpireDate').val($('#ctl00_edit_txtValidPeriod').datebox('getValue'));
                                $('#ctl00_edit_hdScan').val($('#ctl00_edit_cbCanView').attr('checked'));
                                $('#ctl00_edit_hdDownload').val($('#ctl00_edit_cbCanDownload').attr('checked'));
                                $('#ctl00_edit_btnRequestAccess').click();
                            }
                        },
                        {
                            icon: 'close',
                            text: '关闭',
                            handler: function () {
                                $('#dd').dialog('close');
                            }
                        }
                    ]
                    }).dialog('open');

                }
                else {
                    alert('请先选择要申请的资源条目！');
                }
                return false;
            });

        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="button" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="edit" runat="server">
    <div id="SpanSearch" style="display:block;">
        <table class="searchForm" >
            
            <tr>
                <td class="lable2" style=" width:10%;">
                    题名
                </td>
                <td style=" width:20%;">
                    <asp:DropDownList ID="ddlTM" runat="server">
                        <asp:ListItem Text="等于" Value="1"></asp:ListItem>
                        <asp:ListItem Text="包含" Value="2" Selected="True"></asp:ListItem>
                    </asp:DropDownList>
                    <asp:TextBox ID="txtTM" runat="server"></asp:TextBox>
                </td>
                <td class="lable2" style=" width:10%;">
                    井号 
                </td>
                <td style=" width:20%;">
                    <asp:DropDownList ID="ddlWellCode" runat="server">
                        <asp:ListItem Text="等于" Value="1"></asp:ListItem>
                        <asp:ListItem Text="包含" Value="2"></asp:ListItem>
                    </asp:DropDownList>
                    <asp:TextBox ID="txtWellCode" runat="server"></asp:TextBox>
                </td>
                <td rowspan="2" style=" width:15%; text-align:center;" >
                    <asp:Button id="BtnSearch" Text="查询" CssClass="btn"  runat="server"  Height="40"
                        onclick="BtnSearch_Click" />
                    <asp:Button id="BtnResourceRequest" Text="申请访问" CssClass="btn"  runat="server"  Height="40"/>
                </td>
            </tr>
            
            <tr>
                <td class="lable2">
                    施工措施
                </td>
                <td>
                    <asp:DropDownList ID="ddlWorkType" runat="server">
                        <asp:ListItem Text="等于" Value="1"></asp:ListItem>
                        <asp:ListItem Text="包含" Value="2"></asp:ListItem>
                    </asp:DropDownList>
                    <asp:TextBox ID="txtWorkType" runat="server"></asp:TextBox>
                </td>
                <td class="lable2">
                    井别 
                </td>
                <td>
                    <asp:DropDownList ID="ddlWellType" runat="server">
                        <asp:ListItem Text="等于" Value="1"></asp:ListItem>
                        <asp:ListItem Text="包含" Value="2"></asp:ListItem>
                    </asp:DropDownList>
                    <asp:TextBox ID="txtWellType" runat="server"></asp:TextBox>
                </td>
            </tr>
        </table>
    </div>
    <fieldset>
        <ep:EPGridView ID="gv_SingleWellList" runat="server" Width="100%" AutoGenerateColumns="False"
            dataSortExpression="" EnableEmptyContentRender="True" DataKeyNames="DataID" EnableModelValidation="True"
            Goto="0" GvPageCount="0" ShowCheckBox="true">
            <Columns>
                <asp:BoundField DataField="WellDataID" Visible="false" />
                <asp:BoundField DataField="wellcatalogid" Visible="false" />
                <asp:HyperLinkField HeaderText="文件名" DataTextField="DataFileName" DataNavigateUrlFormatString="ResourceRequestApply.aspx?DataID={0}&wellType={1}"
                    DataNavigateUrlFields="DataID,wellcatalogid">
                    <ItemStyle HorizontalAlign="Center" />
                </asp:HyperLinkField>
                <asp:BoundField HeaderText="施工措施" DataField="WORKMODE" HeaderStyle-Width="7%" ItemStyle-HorizontalAlign="Center">
                    <HeaderStyle Width="7%"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundField>
                <asp:BoundField HeaderText="开工日期" DataField="BEGINDATE" HeaderStyle-Width="7%" ItemStyle-HorizontalAlign="Center"
                    DataFormatString="{0: yyyy-MM-dd}">
                    <HeaderStyle Width="7%"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundField>
                <asp:BoundField HeaderText="完工日期" DataField="FINISHDATE" HeaderStyle-Width="7%" ItemStyle-HorizontalAlign="Center"
                    DataFormatString="{0: yyyy-MM-dd}">
                    <HeaderStyle Width="7%"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundField>
                <asp:BoundField HeaderText="井号" DataField="WELLCODE" HeaderStyle-Width="7%" ItemStyle-HorizontalAlign="Center">
                    <HeaderStyle Width="7%"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundField>
                <asp:BoundField HeaderText="井别" DataField="WELLTYPE" HeaderStyle-Width="7%" ItemStyle-HorizontalAlign="Center">
                    <HeaderStyle Width="7%"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundField>
                <asp:BoundField HeaderText="开钻日期" DataField="BEGINWORKDATE" HeaderStyle-Width="7%"
                    ItemStyle-HorizontalAlign="Center" DataFormatString="{0: yyyy-MM-dd}">
                    <HeaderStyle Width="7%"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundField>
                <asp:BoundField HeaderText="完钻日期" DataField="FINISHWORKDATE" HeaderStyle-Width="7%"
                    ItemStyle-HorizontalAlign="Center" DataFormatString="{0: yyyy-MM-dd}">
                    <HeaderStyle Width="7%"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundField>
                <asp:BoundField HeaderText="完钻深度" DataField="WELLDEPTH" HeaderStyle-Width="7%" ItemStyle-HorizontalAlign="Center">
                    <HeaderStyle Width="7%"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:BoundField>
            </Columns>
        </ep:EPGridView>
        <ep:AspNetPager SubmitButtonText=" GO " ID="pagerUndo" Height="26px" Width="100%"
            CssClass="yahoo2" runat="server" PageSize="10" LayoutType="Table" ShowCustomInfoSection="Right"
            CustomInfoClass="custom" CustomInfoStyle=" clear:both;" ShowPageIndexBox="Always"
            SubmitButtonImageUrl="../Images/go.png" ShowPageIndex="true" PageIndexBoxType="TextBox"
            CustomInfoHTML="第 %CurrentPageIndex% 页，共 %PageCount% 页，每页显示 %PageSize% 条，共 %RecordCount% 条"
            OnPageChanging="pagerUntransfered_PageChanging" AlwaysShow="false">
        </ep:AspNetPager>
    </fieldset>

    <div id="dd" class="easyui-dialog" closed="true" >
        <table cellpadding="0" cellspacing="0" width="100%" class="editTable" style=" margin-top:10px;">
            <tr>
                <th>
                    在线浏览
                </th>
                <td>
                    <asp:CheckBox runat="server" ID="cbCanView" />
                </td>
                <th>
                    下载文档
                </th>
                <td>
                    <asp:CheckBox runat="server" ID="cbCanDownload" />
                </td>
                
            </tr>
            <tr>
                <th>
                    申请期限
                </th>
                <td colspan="3">
                    <asp:TextBox ID="txtValidPeriod"  runat="server" Width="180px"  class="easyui-datebox "></asp:TextBox>
                </td>
            </tr>
        </table>
    </div>
        <button type="button" class="sexybutton" id="btnRequestAccess" runat="server" style=" display:none;"
            onserverclick="btnRequestAccess_Click">
            <span><span><span class="disk">申请访问</span></span></span></button>
        <asp:HiddenField runat="Server" ID="hdDownload" />
        <asp:HiddenField runat="Server" ID="hdScan" />
        <asp:HiddenField runat="server" ID="hdExpireDate" />
</asp:Content>
